<template>
  <div>
    <a-input-search @search="chooseUser" read-only v-model="code" placeholder="请选择报销单">
      <a-button slot="enterButton" :disabled="disabled">选择</a-button>
    </a-input-search>
    <j-select-expense-report-modal ref="selectModal" :modal-width="modalWidth" @submit="submit"></j-select-expense-report-modal>
  </div>
</template>
<script>
  import JSelectExpenseReportModal from './modal/JSelectExpenseReportModal'

  export default {
    name: 'JSelectExpenseReport',
    components: { JSelectExpenseReportModal },
    props: {
      modalWidth: {
        type: Number,
        default: 1250,
        required: false,
      },
      disabled: {
        type: Boolean,
        required: false,
        default: false,
      },
    },
    data() {
      return {
        description:'报销发票管理->报销单弹出',
        placeholder: '请选择报销单',
        selectedInfo: {},
        code:''
      }
    },
    methods: {
      chooseUser() {
        this.$refs.selectModal.open()
      },
      submit(record) {
        console.log(record)
        this.selectedInfo = record
        this.code=record.reimbursementCode
        this.$emit('callback', record)
      },
    },
  }
</script>
<style scoped>
  .showData {
    position: absolute;
    width: 80%;
    top: 6px;
    left: 10px;
    height: 28px;
    line-height: 28px;
    border-radius: 5px;
    background: #fff;
    color: rgba(0, 0, 0, 0.35);
  }
</style>